<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title></title>
	<include file="Public/header" />
</head>
<body>
<script type="text/javascript">
	var materialEditUrl="{:U('Stock/materialSave')}";//更新数据
	var getmaterialUrl="{:U('Stock/get_material')}";
	var materialDelUrl="{:U('Stock/materialDel')}";
	var materialExamineUrl="{:U('Stock/examinematerial')}";
	var materialClearUrl="{:U('Stock/materialClear')}";
	var materialUndoUrl="{:U('Stock/materialUndo')}";
	var booksInfoUrl="{:U('Depot/booksCateInfo')}";
	var materialInfoUrl="{:U('Stock/materialInfo')}";//耗材入库单详情
	var order_id="{:I('id')}";	//对应id
	var viewPackageMaterialUrl="{:U('Stock/packagematerial')}";//查看耗材库存
	var viewPackageMaterialbooksUrl="{:U('Stock/packagematerialbooks')}";//耗材账册
	
	var material_order_no="{$order_no}";//单号
	
	var inboundmaterialUrl="{:U('Stock/material_inbound')}";//入库链接
	var material_ordernoUrl="{:U('Stock/ajax_material_orderno')}";//ajax入库单号
	<!-- using('../../../default/js/material.js'); -->
</script>
<script type="text/javascript" src="__PUBLIC__/default/js/material.js"></script>

	<table id="materialDatagrid" toolbar="#material_tb"></table>
	<!-- 添加 -->
	<div id="materialAddDialog" class="easyui-dialog" title="规则添加" style="width:500px;padding:10px 20px;"
        closed="true" buttons="#materialAddButtons"  modal="true">
         <form id="materialAddForm" method="post" novalidate>
			<div class="fitem">
                <label>单号</label>
                <input name="order_no" id="material_order_no" class="easyui-textbox" data-options="readonly:true,required:true,delay:1000,height:30,validType:['length[2,30]']" />
            </div>
            <div class="fitem">
                <label>申请部门</label>
                <select class="easyui-combobox" name="section_no" id="material_section_no" style="width:70px;height:30px;" data-options="required:true,editable:false,panelHeight:'false',validType:['length[2,30]','selected[]']">
                    <volist name="sectionlist" id="vo">
                        <option value="{$vo['no']}">{$vo['name']}</option>
                    </volist>
                </select>
            </div>
			<div class="fitem">
                <label>制单人</label>
                <select class="easyui-combobox" name="people_make_no" id="material_people_make_no" style="width:70px;height:30px;" data-options="required:true,editable:false,panelHeight:'false',validType:['length[2,30]','selected[]']">
                    <volist name="personnellist" id="vo">
                        <option value="{$vo['no']}">{$vo['name']}</option>
                    </volist>
                </select>
            </div>
			<div class="fitem">
                <label>申请人</label>
                <select class="easyui-combobox" name="people_purchasing_no" id="material_people_purchasing_no" style="width:70px;height:30px;" data-options="required:true,editable:false,panelHeight:'false',validType:['length[2,30]','selected[]']">
                    <volist name="personnellist" id="vo">
                        <option value="{$vo['no']}">{$vo['name']}</option>
                    </volist>
                </select>   
            </div>
			<div class="fitem">
                <label>往来单位</label>
                <select class="easyui-combobox" name="contacts_company_no" id="material_contactsCompany" style="width:70px;height:30px;" data-options="required:true,editable:false,panelHeight:'false',validType:['length[2,30]','selected[]']">
                    <volist name="contactsCompanylist" id="vo">
                        <option value="{$vo['no']}">{$vo['name']}</option>
                    </volist>
                </select>   
            </div>

         </form>
    </div>
    <div id="materialAddButtons">
    	<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="materialObj.add('{:U('Stock/materialAdd')}')" style="width:90px">添加</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#materialAddDialog').dialog('close')" style="width:90px">取消</a>
    </div>
    <!-- /添加 -->
	<!-- 编辑 -->
    <div id="materialEditDialog" class="easyui-dialog" style="width:400px;padding:10px 20px"
            closed="true" buttons="#materialEditButtons"  modal="true">
        <form id="materialEditForm" method="post" novalidate>          
            <div class="fitem">
                <label>单号</label>
				 <input name="id"  type="hidden" />
                <input name="order_no" class="easyui-textbox" data-options="readonly:true,required:true,disabled:true,delay:1000,height:30" />
            </div>
            <div class="fitem">
                <label>申请部门</label>
                <select class="easyui-combobox" name="section_no" id="material_section_no" style="width:70px;height:30px;" data-options="required:true,editable:false,panelHeight:'false',validType:['length[2,30]','selected[]']">
                    <volist name="sectionlist" id="vo">
                        <option value="{$vo['no']}">{$vo['name']}</option>
                    </volist>
                </select>
            </div>
			<div class="fitem">
                <label>制单人</label>
                <select class="easyui-combobox" name="people_make_no" id="material_people_make_no" style="width:70px;height:30px;" data-options="required:true,editable:false,panelHeight:'false',validType:['length[2,30]','selected[]']">
                    <volist name="personnellist" id="vo">
                        <option value="{$vo['no']}">{$vo['name']}</option>
                    </volist>
                </select>
            </div>
			<div class="fitem">
                <label>申请人</label>
                <select class="easyui-combobox" name="people_purchasing_no" id="material_people_purchasing_no" style="width:70px;height:30px;" data-options="required:true,editable:false,panelHeight:'false',validType:['length[2,30]','selected[]']">
                    <volist name="personnellist" id="vo">
                        <option value="{$vo['no']}">{$vo['name']}</option>
                    </volist>
                </select>   
            </div>
			<div class="fitem">
                <label>往来单位</label>
                <select class="easyui-combobox" name="contacts_company_no" style="width:70px;height:30px;" data-options="required:true,editable:false,panelHeight:'false',validType:['length[2,30]','selected[]']">
                    <volist name="contactsCompanylist" id="vo">
                        <option value="{$vo['no']}">{$vo['name']}</option>
                    </volist>
                </select>   
            </div>
        </form>
    </div>
    <div id="materialEditButtons">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="materialObj.save('{:U('Stock/materialSave')}')" style="width:90px">更新</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:
    $('#materialEditDialog').dialog('close')" style="width:90px">取消</a>
    </div>
    <!-- /编辑 -->
    <!-- 搜索栏 -->
    <div id="material_tb">
        <form id="materialSearchForm" method="post" novalidate>
             <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon icon-all" plain="true" onclick="materialObj.showAll()">全部</a>     
			 单号:<input class="easyui-textbox" name="order_no" style="width:150px;height:30px;"> 
			 申请人:<select class="easyui-combobox" name="people_purchasing_no"  style="width:70px;height:30px;" >
						<volist name="personnellist" id="vo">
							<option value="{$vo['no']}">{$vo['name']}</option>
						</volist>
					</select> 
			 制单人:<select class="easyui-combobox" name="people_make_no"  style="width:70px;height:30px;" >
						<volist name="personnellist" id="vo">
							<option value="{$vo['no']}">{$vo['name']}</option>
						</volist>
					</select> 
			<a href="#" class="easyui-linkbutton searchBar" iconCls="icon-search" style="height:30px;">搜索</a>
        </form>
		<a href="javascript:void(0)" onclick="materialObj.infoBar()" class="easyui-linkbutton" data-options="iconCls:'icon-information',plain:true">详情</a>
		<a href="javascript:void(0)" onclick="materialObj.addBar()" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">添加</a>
        <a href="javascript:void(0)" onclick="materialObj.editBar()" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true">修改</a>
        <a href="javascript:void(0)" onclick="materialObj.removeBar()" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true">删除</a>
		<a href="javascript:void(0)" onclick="materialObj.reloadBar()" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true">刷新</a>
		<a href="javascript:void(0)" onclick="materialObj.saveBar()" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true">保存</a>
        <a href="javascript:void(0)" onclick="materialObj.examineBar(1)" class="easyui-linkbutton" data-options="iconCls:'icon-key',plain:true">审核通过</a>
		<a href="javascript:void(0)" onclick="materialObj.examineBar(2)" class="easyui-linkbutton" data-options="iconCls:'icon-key_delete',plain:true">审核不通过</a>
		<a href="javascript:void(0)" class="easyui-menubutton" data-options="menu:'#material_mm1',iconCls:'icon-recycle'">回收站</a>
		<div id="material_mm1" style="width:150px;">
			<div onclick="materialObj.recycle()">查看</div>
			<div onclick="materialObj.undoBar()" data-options="iconCls:'icon-undo'">恢复</div>
			<div onclick="materialObj.clearBar()" data-options="iconCls:'icon-remove'">删除</div>
		</div>
		<a href="javascript:void(0)" onclick="materialObj.inboundBar()" class="easyui-linkbutton" data-options="iconCls:'icon-door_in',plain:true">入库</a>
		<a href="javascript:void(0)" onclick="materialObj.viewBar()" class="easyui-linkbutton" data-options="iconCls:'icon-application_form',plain:true">查看库存</a>
		<a href="javascript:void(0)" onclick="materialObj.viewbooksBar()" class="easyui-linkbutton" data-options="iconCls:'icon-table',plain:true">耗材账册</a>
    </div>
    <!-- /搜索栏 -->
</body>